﻿using System.Linq;
using System.Collections.Generic;
using System;

namespace Haushaltsbuch.Extensions
{
    public class CslaScreen<T> : CslaScreenBase<T>
    {
        #region Verbs

        /// <summary>
        /// Saves the Model, first committing changes
        /// if ManagedObjectLifetime is true.
        /// </summary>
        public virtual void Save()
        {
            this.BeginSave();
        }

        /// <summary>
        /// Cancels changes made to the model 
        /// if ManagedObjectLifetime is true.
        /// </summary>
        public virtual void Cancel()
        {
            this.DoCancel();
        }

        /// <summary>
        /// Adds a new item to the Model (if it
        /// is a collection).
        /// </summary>
        public virtual void AddNew()
        {
            this.DoAddNew();
        }

        /// <summary>
        /// Removes an item from the Model (if it
        /// is a collection).
        /// </summary>
        public virtual void Remove(T model)
        {
            this.DoRemove(model);
        }

        /// <summary>
        /// Marks the Model for deletion (if it is an
        /// editable root object).
        /// </summary>
        public virtual void Delete()
        {
            this.DoDelete();
        }

        #endregion

    }
}